﻿namespace NetSurveillance.WebApp.Models
{
    public class ListModel
    {
        private int _pageIndex = 1;
        private string _order = "desc";
        private string _orderField = "Id";

        public int PageIndex
        {
            get { return _pageIndex <= 0 ? 1 : _pageIndex; }
            set { _pageIndex = value; }
        }

        public int TotalCount { get; set; }

        public string CurrentCount { get; set; }

        public bool IsLastPage { get; set; }

        public bool DisplayAll { get; set; }

        public string OrderField
        {
            get { return _orderField; }
            set { _orderField = value; }
        }

        public string Order
        {
            get { return _order == "asc" ? "asc" : "desc"; }
            set { _order = value; }
        }
    }
}